JBoss Community Archive (Read Only)

SwitchYard 0.7

HornetQ Bindings

The HornetQ gateway allows you to send and receive messages via a HornetQ queue.

Binding Services with HornetQ

Composite-level services can be bound to a HornetQ queue using the <binding.hornetq> binding definition.  The following configuration options are required for binding.hornetq:

  • connector : provides connection details for communicating with the HornetQ server.

  • operationSelector : specification of the operation name to use for the message exchange.  If the target service only has a single operation, this setting is optional.

Additional HornetQ binding configuration options can be found in the HornetQ config schema.  Here's an example of what a service binding looks like using a Camel component:

<sca:composite name="HornetQServiceExample" targetNamespace="urn:userguide:hornetq-example-service:0.1.0">
    <sca:service name="HornetQService" promote="SomeService">
        <hornetq:binding.hornetq>
            <hornetq:operationSelector operationName="greet"/>
            <hornetq:config>
                <hornetq:connector>
                   <hornetq:factoryClass>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</hornetq:factoryClass>
                </hornetq:connector>
                <hornetq:queue>jms.queue.ServiceQueue</hornetq:queue>
            </hornetq:config>
        </hornetq:binding.hornetq>
    </service>
    <!-- sca:component definition omitted -->
</sca:composite>

Binding References with HornetQ

Binding a reference with HornetQ is very similar to binding a service.  The only significant difference is that specification of the operationSelector is not required on reference bindings.

<sca:composite name="HornetQReferenceExample" targetNamespace="urn:userguide:hornetq-example-reference:0.1.0">
    <sca:reference name="HornetQReference" promote="SomeComponent/SomeServiceReference" multiplicity="1..1">
        <hornetq:binding.hornetq>
           <hornetq:config>
              <hornetq:connector>
                 <hornetq:factoryClass>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</hornetq:factoryClass>
              </hornetq:connector>
              <hornetq:queue>jms.queue.ReferenceQueue</hornetq:queue>
           </hornetq:config>
        </hornetq:binding.hornetq>
    </sca:reference>
</sca:composite>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 09:47:13 UTC, last content change 2011-12-06 14:45:24 UTC.